﻿@inject IStringLocalizer<CheckboxOnStateChanged> Localizer

<div class="row g-3 form-inline">
    <div class="col-12">
        <Checkbox TValue="bool" DisplayText="@Localizer["Checkbox2Text"]" ShowLabel="true" @bind-Value="@BindValue" OnStateChanged="@OnItemChanged" />
    </div>
    <div class="col-12">
        <BootstrapInput @bind-Value="@BindValue" IsDisabled="true" />
    </div>
</div>
<ConsoleLogger @ref="Logger" class="mt-3" />

@code {
    private bool BindValue { get; set; }

    [NotNull]
    private ConsoleLogger? Logger { get; set; }

    private Task OnItemChanged(CheckboxState state, bool value)
    {
        Logger.Log($"CheckboxState: {state} - Bind Value: {value}");
        return Task.CompletedTask;
    }
}
